<template>
    <div>
        <Form ref="form1" :model="form1" :label-width="120">
            <Row :gutter="16" class="query-form2">
                <i-col span="8">
                    <FormItem label="检查名称:">
                        <Input type="text" v-model="form1.taskName"/>
                    </FormItem>
                </i-col>
                <i-col span="8">
                    <FormItem label="问题状态:">
                        <Select v-model="form1.ifverify">
                            <Option value="0">新建</Option>
                            <Option value="1">审核中</Option>
                            <Option value="2">待整改</Option>
                            <Option value="3">整改中</Option>
                            <Option value="4">待验证</Option>
                            <Option value="5">验证中</Option>
                            <Option value="6">已关闭</Option>
                            <Option value="7">验证驳回</Option>
                        </Select>
                    </FormItem>
                </i-col>
                <i-col span="8">
                    <div style="float: right;">
                        <Button class="ivu-btn-query"  icon="md-search"  @click="query">查询</Button>
                        <Button class="ivu-btn-reset" style="margin-left: 10px" @click="reset">重置</Button>
                    </div>
                </i-col>
            </Row>
        </Form>
        <Table ref='table' style="margin-top: 10px" :loading="loading" border :columns="columns" no-data-text="没有查询到相关数据！"
               :data="infos" width="100%" :height="tableHeight" highlight-row stripe size="small"></Table>
        <Row type="flex" justify="end" >
            <i-col>
                <Page :total="pagedata.total" :current="pagedata.currentPage" :page-size="pagedata.pageSize"
                      @on-page-size-change="pageSizeChange" @on-change="pageChange" :page-size-opts="pageSizeArray" show-total show-sizer show-elevator />
            </i-col>
        </Row>
        <Modal v-model="modal1" width="900" class="modal-view-detail" title="问题查看">
            <Spin fix v-if="spinShow">
                <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
                <div>数据加载中</div>
            </Spin>
            <div :style="{overflowY: 'auto', height: divHeight}">
                <Form  ref="dataForm" :label-width="120">
                    <Row>
                        <i-col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">问题基本信息</span></Divider>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="23">
                            <FormItem label="检查名称:" prop="taskName">
                                {{chkProblem.taskName}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="23">
                            <FormItem label="存在单位:" prop="existOrgName">
                                {{chkProblem.existOrgName}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="11">
                            <FormItem label="检查人:" prop="reportUserName">
                                {{chkProblem.reportUserName}}
                            </FormItem>
                        </i-col>
                        <i-col span="11">
                            <FormItem label="检查日期:" prop="reportDate">
                                {{chkProblem.reportDate}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="11">
                            <FormItem label="问题类型:" prop="problemType">
                                {{chkProblem.problemType=='1'?'基础管理' : '现场管理'}}
                            </FormItem>
                        </i-col>
                        <i-col span="11">
                            <FormItem label="问题状态:" prop="reportStatus">
                                {{chkProblem.reportStatusName}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="23">
                            <FormItem label="问题图片:" prop="reportFile">
                                <div class="demo-upload-list" v-for="item in uploadList" :key="item.id">
                                    <img :src="item.url">
                                    <div class="demo-upload-list-cover">
                                        <Icon type="ios-eye-outline" @click.native="handleView(item.name,item.url)"></Icon>
                                    </div>
                                </div>
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="code-row-bg">
                        <i-col span="23">
                            <FormItem label="问题描述:" prop="reportDesc">
                                {{chkProblem.reportDesc}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row type="flex" justify="space-around" class="detail-background-clor">
                        <i-col span="23">
                            <FormItem label="要求整改时间:">
                                {{chkProblem.rectifyDate}}
                            </FormItem>
                        </i-col>
                    </Row>
                    <Row v-if="ifChkAssign">
                        <i-col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">整改安排</span></Divider>
                        </i-col>
                    </Row>
                    <div v-if="ifChkAssign">
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改人:" prop="expectUser">
                                    {{chkAssign.expectUserName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="整改期限:" prop="expectDate">
                                    {{chkAssign.expectDate}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="验证人:" >
                                    {{chkAssign.verifierName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="整改要求:" prop="expectRect">
                                    {{chkAssign.expectRect}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="填报人:" prop="assignUserId">
                                    {{chkAssign.assignUserName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="填报日期:" prop="assignDate">
                                    {{chkAssign.assignDate}}
                                </FormItem>
                            </i-col>
                        </Row>
                    </div>


                    <Row v-if="bohui.length > 0">
                        <i-col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                            <Divider orientation="left"><span style="font-size:18px;color:#464c5b;font-weight: bold">问题整改历史信息</span></Divider>
                        </i-col>
                    </Row>
                    <div v-for="(item,index) in bohui" :key="index">
                        <Row>
                            <i-col span="24" style="font-size:18px;color:#464c5b;font-weight: bold">
                                <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">第{{index+1}}次整改</span></Divider>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改人:" prop="rectifyUser">
                                    {{item.chkRectify.rectifyUserName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="参与人:" prop="rectifyPersion">
                                    {{item.chkRectify.rectifyPersion}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改开始日期:" prop="rectifyDate">
                                    {{item.chkRectify.rectifyDate}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="整改结束日期:" prop="expirationTime">
                                    {{item.chkRectify.expirationTime}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="整改情况描述:" prop="rectifyDesc">
                                    {{item.chkRectify.rectifyDesc}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="验证人:" prop="verifier">
                                    {{item.chkRectify.verifierName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="整改图片:" prop="reportFile">
                                    <div class="demo-upload-list" v-for="obj in item.chkRectify.fileIds" :key="obj">
                                        <img :src="filesUrl + '/' + obj">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(obj,filesUrl + '/' + obj)"></Icon>
                                        </div>
                                    </div>
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row>
                            <i-col span="24" style="font-size:18px;color:#464c5b;font-weight: bold">
                                <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">第{{index+1}}次验证</span></Divider>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="验证人:" prop="verifier">
                                    {{item.chkVerify.verifierName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="验证日期:" prop="verifyDate">
                                    {{item.chkVerify.verifyDate}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改结果:" prop="verifyResult">
                                    {{item.chkVerify.verifyResult=='1'?'通过':item.chkVerify.verifyResult=='0'?'不通过':''}}
                                </FormItem>
                            </i-col>
                            <i-col span="11" v-if="item.chkVerify.verifyResult=='1'">
                                <FormItem label="关闭日期:" prop="closedDate">
                                    {{item.chkVerify.closedDate}}
                                </FormItem>
                            </i-col>
                            <i-col span="11" v-else> </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="验证情况描述:" prop="verifyDesc">
                                    {{item.chkVerify.verifyDesc}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="验证图片:" prop="reportFile">
                                    <div class="demo-upload-list" v-for="obj in item.chkVerify.fileIds" :key="obj">
                                        <img :src="filesUrl + '/' + obj">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(obj,filesUrl + '/' + obj)"></Icon>
                                        </div>
                                    </div>
                                </FormItem>
                            </i-col>
                        </Row>
                    </div>
                    <div v-if="bohui.length == 0">
                    <div v-if="chkRectify != undefined">
                        <Row>
                            <i-col span="24" style="font-size:20px;color:#464c5b;font-weight: bold">
                                <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">问题整改信息</span></Divider>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改人:" prop="rectifyUser">
                                    {{chkRectify.rectifyUserName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="参与人:" prop="rectifyPersion">
                                    {{chkRectify.rectifyPersion}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改开始日期:" prop="rectifyDate">
                                    {{chkRectify.rectifyDate}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="整改结束日期:" prop="expirationTime">
                                    {{chkRectify.expirationTime}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="整改情况描述:" prop="rectifyDesc">
                                    {{chkRectify.rectifyDesc}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改期限:" prop="expectDate">
                                    {{chkAssign.expectDate}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="验证人:" prop="verifier">
                                    {{chkRectify.verifierName}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="整改图片:" prop="reportFile">
                                    <div class="demo-upload-list" v-for="item in chkRectify.fileIds" :key="item">
                                        <img :src="filesUrl + '/' + item">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item,filesUrl + '/' + item)"></Icon>
                                        </div>
                                    </div>
                                </FormItem>
                            </i-col>
                        </Row>
                    </div>
                    <div v-if="viewForm!=undefined">
                        <Row>
                            <i-col span="24" style="font-size:16px;color:#464c5b;font-weight: bold">
                                <Divider orientation="left"><span style="font-size:16px;color:#464c5b;font-weight: bold">问题验证信息</span></Divider>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="验证人:" prop="verifier">
                                    {{viewForm.verifierName}}
                                </FormItem>
                            </i-col>
                            <i-col span="11">
                                <FormItem label="验证日期:" prop="verifyDate">
                                    {{viewForm.verifyDate}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="11">
                                <FormItem label="整改结果:" prop="verifyResult">
                                    {{viewForm.verifyResult=='1'?'通过':viewForm.verifyResult=='0'?'不通过':''}}
                                </FormItem>
                            </i-col>
                            <i-col span="11" v-if="viewForm.verifyResult=='1'">
                                <FormItem label="关闭日期:" prop="closedDate">
                                    {{viewForm.closedDate}}
                                </FormItem>
                            </i-col>
                            <i-col span="11" v-else></i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="验证情况描述:" prop="verifyDesc">
                                    {{viewForm.verifyDesc}}
                                </FormItem>
                            </i-col>
                        </Row>
                        <Row type="flex" justify="space-around" class="code-row-bg">
                            <i-col span="23">
                                <FormItem label="验证图片:" prop="reportFile">
                                    <div class="demo-upload-list" v-for="item in viewForm.fileIds" :key="item">
                                        <img :src="filesUrl + '/' + item">
                                        <div class="demo-upload-list-cover">
                                            <Icon type="ios-eye-outline" @click.native="handleView(item,filesUrl + '/' + item)"></Icon>
                                        </div>
                                    </div>
                                </FormItem>
                            </i-col>
                        </Row>
                    </div>
                    </div>
                </Form>
            </div>
            <div slot="footer" >
                <Button @click="modal1=false" class="ivu-btn-save">关闭</Button>
            </div>
        </Modal>
        <Modal  v-model="visible" :mask-closable="false" >
            <img :src="viewUrl" v-if="visible" style="width: 100%">
            <div slot="footer">
                <Button type="primary" class='ivu-btn-save'  @click="visible=false">关闭</Button>
            </div>
        </Modal>
    </div>
</template>
<script>

    import {sessionStorage} from '../../../../common/cacheUtils.js';
    import {Api} from '../../../../api/index.js'


    export default {
        name: "verifyShow",
        data(){
            return{
                form1:{},
                spinShow: false,
                loading:false,
                visible: false,
                viewUrl: Api.downloadPTWSchemeFile,
                filesUrl : Api.downloadPTWSchemeFile,
                tableHeight: '',
                columns: [
                    {
                        title: "序号",
                        width: 80,
                        align: "center",
                        fixed:'left',
                        render: (h, params) => {
                            return h('span', params.index + (this.pagedata.currentPage - 1) * this.pagedata.pageSize + 1);
                        }
                    },
                    {
                        minWidth: 180,
                        title: '检查名称',
                        key: 'taskName',
                        align: 'center',
                        tooltip:true
                    },
                    {
                        minWidth: 180,
                        title: '问题描述',
                        key: 'reportDesc',
                        align: 'center',
                        tooltip:true
                    },
                    {
                        minWidth: 100,
                        title: '整改人',
                        key: 'rectifyUserName',
                        align: 'center'
                    },
                    {
                        minWidth: 120,
                        title: '整改结束日期',
                        key: 'expirationTime',
                        align: 'center'
                    },
                    {
                        minWidth: 120,
                        title: '整改情况描述',
                        key: 'rectifyDesc',
                        align: 'center',
                        tooltip:true
                    },
                    {
                        minWidth: 120,
                        title: '整改期限',
                        key: 'expectDate',
                        align: 'center'
                    },
                    {
                        minWidth: 100,
                        title: '验证人',
                        key: 'verifierName',
                        align: 'center'
                    },
                    {
                        minWidth: 120,
                        title: '问题状态',
                        align: 'center',
                        key: 'reportStatus',
                        render: (h, params) => {
                            if(params.row.reportStatus == '0'){
                                return h('span',{ },'新建')
                            }else if(params.row.reportStatus == '1'){
                                return h('span',{ },'审核中')
                            }else if(params.row.reportStatus == '2'){
                                return h('span',{ },'待整改')
                            }else if(params.row.reportStatus == '3'){
                                return h('span',{ },'整改中')
                            }else if(params.row.reportStatus == '4'){
                                return h('span',{ },'待验证')
                            }else if(params.row.reportStatus == '5'){
                                return h('span',{ },'验证中')
                            }else if(params.row.reportStatus == '6'){
                                return h('span',{ },'已关闭')
                            }else if(params.row.reportStatus == '7'){
                                return h('span',{ },'验证驳回')
                            }
                        }
                    },
                    {
                        title: '操作',
                        key: 'action',
                        fixed: 'right',
                        width: 120,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('A', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        fontSize: '14px',
                                    },
                                    on: {
                                        click: () => {
                                            this.viewData(params);
                                        }
                                    }
                                }, '详情')
                            ]);
                        }
                    }
                ],
                infos: [],
                pagedata: {
                    total: 0,
                    pageSize: 10,
                    currentPage: 1,
                },
                pageSizeArray: [10, 20, 50],
                modal1: false,
                dataForm: {},
                chkProblem: {},
                chkVerify: {},
                viewForm:{},
                bohui : {},
                chkAssign: {},
                ifChkAssign: false,
                uploadList: [],
                divHeight: ''
            }
        },
        watch: {
            'modal1': function (qw,er) {
                if(!qw){
                    this.dataForm = {};
                    this.chkProblem = {};
                    this.chkVerify = {};
                    this.viewForm = {};
                    this.bohui = {};
                    this.uploadList = [];
                    this.chkAssign = {};
                    this.ifChkAssign = false;
                }
            }
        },
        mounted(){
            this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 145;
            this.divHeight = window.innerHeight - 200 + 'px';
            this.query();
        },
        methods:{
            query(){
                this.loading = true ;
                let data = {
                    currentPage: this.pagedata.currentPage,
                    size: this.pagedata.pageSize,
                    userId: JSON.parse(sessionStorage('paramUserInfo').get('userInfo'))["createUserId"],
                    checkCategory: 1,
                    reportStatus: '0,1,2,3,4,5,6,7',
                    dataType: 'reportUser'
                }
                if (this.form1.ifverify != undefined) {
                    data.reportStatus= this.form1.ifverify;
                }
                data = Object.assign(data, JSON.parse(JSON.stringify(this.form1)));
                this.$http.get(Api.getChkProblemList, {
                    params: data
                }).then(function(res){
                    this.infos = res.data.data;
                    this.pagedata.total = res.data.totalSize;
                    this.loading = false;
                }, function(res){
                    this.$Message.error('请求失败');
                });
            },
            reset(){
                this.form1 = {};
                this.query();
            },
            viewData(params) {
                this.modal1 = true;
                this.spinShow = true;
                let url = Api.toChkProblemVerify + '/' + params.row.problemId;
                this.$http.get(url, {}).then((res) => {
                    this.chkProblem = res.data.chkProblem;
                    this.chkAssign = res.data.chkAssign;
                    if(res.data.chkAssign != null) this.ifChkAssign = true;
                    this.chkRectify = res.data.chkRectify;

                    this.bohui = res.data.bohui;
                    if(this.bohui == null){
                        this.bohui = [];
                    }else{
                        let map={
                            chkRectify:{...this.chkRectify},
                            chkVerify:{fileIds:null}
                        }
                        this.bohui.push(map)
                        //处理驳回的图片信息
                        for(let i = 0; i < this.bohui.length; i ++){
                            //处理整改图片ID
                            if(this.bohui[i].chkRectify.fileIds!='' && this.bohui[i].chkRectify.fileIds!=null && this.bohui[i].chkRectify.fileIds!=undefined){
                                this.bohui[i].chkRectify.fileIds =  this.bohui[i].chkRectify.fileIds.split(';');
                            }
                            //处理验证图片ID
                            if( this.bohui[i].chkVerify.fileIds!='' &&  this.bohui[i].chkVerify.fileIds!=null &&  this.bohui[i].chkVerify.fileIds!=undefined){
                                this.bohui[i].chkVerify.fileIds =  this.bohui[i].chkVerify.fileIds.split(';');
                            }else {
                                this.bohui[i].chkVerify.fileIds=[]
                            }
                        }
                    }
                    if(this.chkRectify!=undefined){
                        //处理整改图片ID
                        if(this.chkRectify.fileIds!='' && this.chkRectify.fileIds!=null && this.chkRectify.fileIds!=undefined){
                            this.chkRectify.fileIds =this.chkRectify.fileIds.split(';')
                        }
                    }
                    if(res.data.chkVerify!=null){
                        this.viewForm = res.data.chkVerify;
                        //处理验证图片ID
                        if(this.viewForm.fileIds!='' && this.viewForm.fileIds!=null && this.viewForm.fileIds!=undefined){
                            this.viewForm.fileIds = this.viewForm.fileIds.split(';');
                        }
                    }else {
                        this.viewForm = undefined;
                        this.uploadImgs = [];
                    }
                    if(this.chkProblem.reportStatus == '0'){
                        this.chkProblem.reportStatusName = '新建';
                    }else if(this.chkProblem.reportStatus == '1'){
                        this.chkProblem.reportStatusName = '审核中';
                    }else if(this.chkProblem.reportStatus == '2'){
                        this.chkProblem.reportStatusName = '待整改';
                    }else if(this.chkProblem.reportStatus == '3'){
                        this.chkProblem.reportStatusName = '整改中';
                    }else if(this.chkProblem.reportStatus == '4'){
                        this.chkProblem.reportStatusName = '待验证';
                    }else if(this.chkProblem.reportStatus == '5'){
                        this.chkProblem.reportStatusName = '验证中';
                    }else if(this.chkProblem.reportStatus == '6'){
                        this.chkProblem.reportStatusName = '已关闭';
                    }else if(this.chkProblem.reportStatus == '7'){
                        this.chkProblem.reportStatusName = '验证驳回';
                    }
                    this.viewPicture(this.chkProblem);
                    this.viewAuditPicture(this.chkAssign);
                    this.spinShow = false;
                }).catch(e => {
                    this.spinShow = false;
                    // this.$Message.error('请求失败' + e);
                })
            },
            viewPicture(row){
                //根据reportFile查询附件
                this.uploadList = [];
                this.$http.get(Api.uploadPTWFiles + '/' + row.reportFile + '/files', {params: {}}).then((res) => {
                    if(res.data.data!=null){
                        res.data.data.map((item)=>{
                            this.uploadList.push({ name : item.fileName, id : item.id , url : Api.downloadPTWSchemeFile + '/' + item.id});
                        });
                    }
                }).catch(e => {
                    this.$Message.error("数据获取失败")
                })
            },
            viewAuditPicture(row){
                //根据reportFile查询附件
                this.auditImgs = [];
                if(row!= null){
                    this.$http.get(Api.uploadPTWFiles + '/' + row.assignId + '/files', {params: {}}).then((res) => {
                        if(res.data.data!=null){
                            res.data.data.map((item)=>{
                                this.auditImgs.push({ name : item.fileName, id : item.id , url : Api.downloadPTWSchemeFile + '/' + item.id});
                            });
                        }
                    }).catch(e => {
                        this.$Message.error("数据获取失败")
                    })
                }
            },
            handleView (name,url) {
                this.viewUrl = url;
                this.visible = true;
            },
            pageSizeChange(pageSize){
                this.pagedata.pageSize = pageSize;
                this.query();
            },
            pageChange(pageNum){
                this.pagedata.currentPage = pageNum;
                this.query();
            },
        }
    }
</script>

<style lang='css' scoped>
    @import './../../../../index.css';
    .demo-upload-list{
        display: inline-block;
        width: 60px;
        height: 60px;
        text-align: center;
        line-height: 60px;
        border: 1px solid transparent;
        border-radius: 4px;
        overflow: hidden;
        background: #fff;
        position: relative;
        box-shadow: 0 1px 1px rgba(0,0,0,.2);
        margin-right: 4px;
    }
    .demo-upload-list img{
        width: 100%;
        height: 100%;
    }
    .demo-upload-list-cover{
        display: none;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,.6);
    }
    .demo-upload-list:hover .demo-upload-list-cover{
        display: block;
    }
    .demo-upload-list-cover i{
        color: #fff;
        font-size: 20px;
        cursor: pointer;
        margin: 0 2px;
    }
    .demo-spin-icon-load{
        animation: ani-demo-spin 1s linear infinite;
    }
</style>
